package com.mall4j.cloud.product.service.impl;

import com.mall4j.cloud.api.product.vo.AttrCategoryVO;
import com.mall4j.cloud.product.dto.AttrCategoryDTO;
import com.mall4j.cloud.product.mapper.AttrCategoryMapper;
import com.mall4j.cloud.product.model.AttrCategory;
import com.mall4j.cloud.product.service.AttrCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 属性与分类关联
 *
 * @author JCM
 * @date 2023-04-23 09:25:00
 */
@Service
public class AttrCategoryServiceImpl implements AttrCategoryService {

    @Autowired
    private AttrCategoryMapper attrCategoryMapper;

    @Override
    public List<AttrCategoryVO> list(AttrCategoryDTO attrCategoryDTO) {
        return attrCategoryMapper.list(attrCategoryDTO);
    }

    @Override
    public List<AttrCategoryVO> getByCategoryId(Long categoryId) {
        return attrCategoryMapper.getByCategoryId(categoryId);
    }

    @Override
    public void save(AttrCategory attrCategory) {
        attrCategoryMapper.save(attrCategory);
    }

    @Override
    public void deleteByAttrId(Long attrId) {
        attrCategoryMapper.deleteByAttrId(attrId);
    }

}
